package org.itboys.mobile.service.mongo.site;

import org.itboys.mobile.entity.mongo.JoinFavorite;
import org.itboys.mongodb.core.MongoDataSource;
import org.itboys.mongodb.service.BaseMongoService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

/**
 * 作者：zzq
 * 时间：2017/9/26
 * 描述：雄安加盟网_
 */
@Service
public class JoinSiteFavoriteService extends BaseMongoService<JoinFavorite>{
    @Resource(name = "mobileDs")
    private MongoDataSource mobileDataSource;
    @Override
    protected MongoDataSource getMongoDataSource() {
        return mobileDataSource;
    }

    @Override
    protected Class<JoinFavorite> getEntityClass() {
        return JoinFavorite.class;
    }

    /**
     * 取消关注
     * @param memberRecordId
     * @param otherId
     */
    public void cancel(Long memberRecordId,Long otherId){
        Map<String,Object> param=new HashMap<String,Object>();
        param.put("memberRecordId",memberRecordId);
        param.put("otherId",otherId);
        super.delete(param);
    }
}
